<?php
/**
 * $files (array of File) files to show
 */
?>
<div id="fileList">
    <div style="float:left;">
        <?php
        for($i=0; $i<count($files); $i++):
            $file=$files[$i];
            $fileDir = $file->status==0 ? UploadWidget::$tempDir : UploadWidget::$fileDir;
            ?>
        <a href="<?= UploadUtils::getUrl($fileDir)."/".$file->filename; ?>"
           title="<?=$file->filename?> (<?=round($file->filesize/1024, 2)?> Kb)">
            <?php if (UploadUtils::isImageFileMime($file->filemime)): ?>
                <img height="50px" alt="<?=$file->filename?>"
                     src="<?= UploadUtils::getUrl($fileDir)."/".$file->filename; ?>"/>
            <?php else: ?>
                <?=$file->filename?>
            <?php endif; ?>
        </a>
        <?php endfor; ?>
    </div>
    <div style="clear:both;"></div>
</div>